#pragma once
#include "FormatedTransfer.h"

/**
 * 链表节点数据结构
 */
class ListNode:public FormatedContainer<int>
{
public:
	int val;
	ListNode* next;

	ListNode();
	ListNode(int x);
	ListNode(int x, ListNode* next);
	~ListNode() override = default;

	//禁止直接拷贝
	ListNode(const ListNode& other) = delete;
	ListNode& operator=(const ListNode& other) = delete;

	//链表内容相等性判断
	bool operator==(const ListNode& other) const;
	bool operator!=(const ListNode& other) const;

	//格式化串转入转出
	String dumpFormated(const String& elem_splitter, const String& wrapper) override;
	void parseFormated(const String& formated_str, const String& elem_splitter, const String& noise) override;

	String dumpFormated();
	void parseFormated(const String& formated_str);
};
